{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "775c1123",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " * Serving Flask app \"__main__\" (lazy loading)\n",
      " * Environment: production\n",
      "\u001b[31m   WARNING: This is a development server. Do not use it in a production deployment.\u001b[0m\n",
      "\u001b[2m   Use a production WSGI server instead.\u001b[0m\n",
      " * Debug mode: off\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      " * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)\n",
      "127.0.0.1 - - [13/Dec/2023 20:02:37] \"GET / HTTP/1.1\" 200 -\n",
      "127.0.0.1 - - [13/Dec/2023 20:02:37] \"GET /assets/favicons/favicon.ico HTTP/1.1\" 404 -\n",
      "127.0.0.1 - - [13/Dec/2023 20:02:44] \"POST /Chart HTTP/1.1\" 302 -\n",
      "127.0.0.1 - - [13/Dec/2023 20:02:44] \"GET /python_sh HTTP/1.1\" 200 -\n",
      "127.0.0.1 - - [13/Dec/2023 20:02:44] \"GET /favicon.ico HTTP/1.1\" 404 -\n",
      "127.0.0.1 - - [13/Dec/2023 20:02:50] \"POST /Chart HTTP/1.1\" 302 -\n",
      "127.0.0.1 - - [13/Dec/2023 20:02:50] \"GET /pr_sz HTTP/1.1\" 200 -\n",
      "127.0.0.1 - - [13/Dec/2023 20:03:30] \"POST /Chart HTTP/1.1\" 302 -\n",
      "127.0.0.1 - - [13/Dec/2023 20:03:30] \"GET /ps_gz HTTP/1.1\" 200 -\n",
      "127.0.0.1 - - [13/Dec/2023 20:03:51] \"GET / HTTP/1.1\" 200 -\n",
      "127.0.0.1 - - [13/Dec/2023 20:04:30] \"POST /Chart HTTP/1.1\" 302 -\n",
      "127.0.0.1 - - [13/Dec/2023 20:04:30] \"GET /dy_gz HTTP/1.1\" 200 -\n"
     ]
    }
   ],
   "source": [
    "from flask import render_template, redirect, url_for, request, Flask\n",
    "\n",
    "app = Flask(__name__)\n",
    "\n",
    "route_mapping = {\n",
    "    ('Python', '北京'): 'python_bj',\n",
    "    ('Python', '上海'): 'python_sh',\n",
    "    ('Python', '广州'): 'python_gz',\n",
    "    ('Python', '深圳'): 'python_sz',\n",
    "    ('java', '北京'): 'java_bj',\n",
    "    ('java', '上海'): 'java_sh',\n",
    "    ('java', '广州'): 'java_gz',\n",
    "    ('java', '深圳'): 'java_sz',\n",
    "    ('产品经理', '北京'): 'pr_bj',\n",
    "    ('产品经理', '上海'): 'pr_sh',\n",
    "    ('产品经理', '广州'): 'pr_gz',\n",
    "    ('产品经理', '深圳'): 'pr_sz',\n",
    "    ('产品助理', '北京'): 'ps_bj',\n",
    "    ('产品助理', '上海'): 'ps_sh',\n",
    "    ('产品助理', '广州'): 'ps_gz',\n",
    "    ('产品助理', '深圳'): 'ps_sz',\n",
    "    ('广告', '北京'): 'gg_bj',\n",
    "    ('广告', '上海'): 'gg_sh',\n",
    "    ('广告', '广州'): 'gg_gz',\n",
    "    ('广告', '深圳'): 'gg_sz',\n",
    "    ('Web前端', '北京'): 'web_bj',\n",
    "    ('Web前端', '上海'): 'web_sh',\n",
    "    ('Web前端', '广州'): 'web_gz',\n",
    "    ('Web前端', '深圳'): 'web_sz',\n",
    "    ('用户运营', '北京'): 'yh_bj',\n",
    "    ('用户运营', '上海'): 'yh_sh',\n",
    "    ('用户运营', '广州'): 'yh_gz',\n",
    "    ('用户运营', '深圳'): 'yh_sz',\n",
    "    ('产品运营', '北京'): 'cp_bj',\n",
    "    ('产品运营', '广州'): 'cp_gz',\n",
    "    ('产品运营', '上海'): 'cp_sh',\n",
    "    ('产品运营', '深圳'): 'cp_sz',\n",
    "    ('小程序运营', '北京'): 'xcx_bj',\n",
    "    ('小程序运营', '上海'): 'xcx_sh',\n",
    "    ('小程序运营', '广州'): 'xcx_gz',\n",
    "    ('小程序运营', '深圳'): 'xcx_sz',\n",
    "    ('导演', '北京'): 'dy_bj',\n",
    "    ('导演', '上海'): 'dy_sh',\n",
    "    ('导演', '广州'): 'dy_gz',\n",
    "    ('导演', '深圳'): 'dy_sz',\n",
    "    ('影视后期', '北京'): 'hq_bj',\n",
    "    ('影视后期', '上海'): 'hq_sh',\n",
    "    ('影视后期', '广州'): 'hq_gz',\n",
    "    ('影视后期', '深圳'): 'hq_sz',\n",
    "    ('主播', '北京'): 'zb_bj',\n",
    "    ('主播', '上海'): 'zb_sh',\n",
    "    ('主播', '广州'): 'zb_gz',\n",
    "    ('主播', '深圳'): 'zb_sz',\n",
    "    \n",
    "    \n",
    "    \n",
    "    \n",
    "}\n",
    "\n",
    "@app.route('/')\n",
    "def index():\n",
    "    return render_template('index.html')\n",
    "\n",
    "@app.route('/Chart', methods=['POST'])\n",
    "def get_bar_chart():\n",
    "    keyword = request.form.get('job')\n",
    "    city = request.form.get('location')\n",
    "\n",
    "    route_key = (keyword, city)\n",
    "    target_route = route_mapping.get(route_key, 'index')\n",
    "\n",
    "    return redirect(url_for(target_route))\n",
    "\n",
    "\n",
    "\n",
    "@app.route('/python_bj')\n",
    "def python_bj():\n",
    "    return render_template('python_bj.html')\n",
    "\n",
    "@app.route('/python_sh')\n",
    "def python_sh():\n",
    "    return render_template('python_sh.html')\n",
    "\n",
    "@app.route('/python_gz')\n",
    "def python_gz():\n",
    "    return render_template('python_gz.html')\n",
    "\n",
    "@app.route('/python_sz')\n",
    "def python_sz():\n",
    "    return render_template('python_sz.html')\n",
    "\n",
    "@app.route('/java_bj')\n",
    "def java_bj():\n",
    "    return render_template('java_bj.html')\n",
    "\n",
    "@app.route('/java_sh')\n",
    "def java_sh():\n",
    "    return render_template('java_sh.html')\n",
    "\n",
    "@app.route('/java_gz')\n",
    "def java_gz():\n",
    "    return render_template('java_gz.html')\n",
    "\n",
    "@app.route('/java_sz')\n",
    "def java_sz():\n",
    "    return render_template('java_sz.html')\n",
    "\n",
    "@app.route('/pr_bj')\n",
    "def pr_bj():\n",
    "    return render_template('pr_bj.html')\n",
    "\n",
    "@app.route('/pr_sh')\n",
    "def pr_sh():\n",
    "    return render_template('pr_sh.html')\n",
    "\n",
    "@app.route('/pr_gz')\n",
    "def pr_gz():\n",
    "    return render_template('pr_gz.html')\n",
    "\n",
    "@app.route('/pr_sz')\n",
    "def pr_sz():\n",
    "    return render_template('pr_sz.html')\n",
    "\n",
    "@app.route('/ps_bj')\n",
    "def ps_bj():\n",
    "    return render_template('ps_bj.html')\n",
    "\n",
    "@app.route('/ps_sh')\n",
    "def ps_sh():\n",
    "    return render_template('ps_sh.html')\n",
    "\n",
    "@app.route('/ps_gz')\n",
    "def ps_gz():\n",
    "    return render_template('ps_gz.html')\n",
    "\n",
    "@app.route('/ps_sz')\n",
    "def ps_sz():\n",
    "    return render_template('ps_sz.html')\n",
    "\n",
    "@app.route('/gg_bj')\n",
    "def gg_bj():\n",
    "    return render_template('gg_bj.html')\n",
    "\n",
    "@app.route('/gg_sh')\n",
    "def gg_sh():\n",
    "    return render_template('gg_sh.html')\n",
    "\n",
    "@app.route('/gg_gz')\n",
    "def gg_gz():\n",
    "    return render_template('gg_gz.html')\n",
    "\n",
    "@app.route('/gg_sz')\n",
    "def gg_sz():\n",
    "    return render_template('gg_sz.html')\n",
    "\n",
    "@app.route('/web_bj')\n",
    "def web_bj():\n",
    "    return render_template('web_bj.html')\n",
    "\n",
    "@app.route('/web_sh')\n",
    "def web_sh():\n",
    "    return render_template('web_sh.html')\n",
    "\n",
    "@app.route('/web_gz')\n",
    "def web_gz():\n",
    "    return render_template('web_gz.html')\n",
    "\n",
    "@app.route('/web_sz')\n",
    "def web_sz():\n",
    "    return render_template('web_sz.html')\n",
    "\n",
    "@app.route('/yh_bj')\n",
    "def yh_bj():\n",
    "    return render_template('yh_bj.html')\n",
    "\n",
    "@app.route('/yh_sh')\n",
    "def yh_sh():\n",
    "    return render_template('yh_sh.html')\n",
    "\n",
    "@app.route('/yh_gz')\n",
    "def yh_gz():\n",
    "    return render_template('yh_gz.html')\n",
    "\n",
    "@app.route('/yh_sz')\n",
    "def yh_sz():\n",
    "    return render_template('yh_sz.html')\n",
    "\n",
    "@app.route('/cp_bj')\n",
    "def cp_bj():\n",
    "    return render_template('cp_bj.html')\n",
    "\n",
    "@app.route('/cp_sh')\n",
    "def cp_sh():\n",
    "    return render_template('cp_sh.html')\n",
    "\n",
    "@app.route('/cp_gz')\n",
    "def cp_gz():\n",
    "    return render_template('cp_gz.html')\n",
    "\n",
    "@app.route('/cp_sz')\n",
    "def cp_sz():\n",
    "    return render_template('cp_sz.html')\n",
    "\n",
    "@app.route('/xcx_bj')\n",
    "def xcx_bj():\n",
    "    return render_template('xcx_bj.html')\n",
    "\n",
    "@app.route('/xcx_sh')\n",
    "def xcx_sh():\n",
    "    return render_template('xcx_sh.html')\n",
    "\n",
    "@app.route('/xcx_gz')\n",
    "def xcx_gz():\n",
    "    return render_template('xcx_gz.html')\n",
    "\n",
    "@app.route('/xcx_sz')\n",
    "def xcx_sz():\n",
    "    return render_template('xcx_sz.html')\n",
    "\n",
    "@app.route('/dy_bj')\n",
    "def dy_bj():\n",
    "    return render_template('dy_bj.html')\n",
    "\n",
    "@app.route('/dy_sh')\n",
    "def dy_sh():\n",
    "    return render_template('dy_sh.html')\n",
    "\n",
    "@app.route('/dy_gz')\n",
    "def dy_gz():\n",
    "    return render_template('dy_gz.html')\n",
    "\n",
    "@app.route('/dy_sz')\n",
    "def dy_sz():\n",
    "    return render_template('dy_sz.html')\n",
    "\n",
    "@app.route('/hq_bj')\n",
    "def hq_bj():\n",
    "    return render_template('hq_bj.html')\n",
    "\n",
    "@app.route('/hq_sh')\n",
    "def hq_sh():\n",
    "    return render_template('hq_sh.html')\n",
    "\n",
    "@app.route('/hq_gz')\n",
    "def hq_gz():\n",
    "    return render_template('hq_gz.html')\n",
    "\n",
    "@app.route('/hq_sz')\n",
    "def hq_sz():\n",
    "    return render_template('hq_sz.html')\n",
    "\n",
    "@app.route('/zb_bj')\n",
    "def zb_bj():\n",
    "    return render_template('zb_bj.html')\n",
    "\n",
    "@app.route('/zb_sh')\n",
    "def zb_sh():\n",
    "    return render_template('zb_sh.html')\n",
    "\n",
    "@app.route('/zb_gz')\n",
    "def zb_gz():\n",
    "    return render_template('zb_gz.html')\n",
    "\n",
    "@app.route('/zb_sz')\n",
    "def zb_sz():\n",
    "    return render_template('zb_sz.html')\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    app.run()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "69b519b8",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "95fc4e9c",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
